package com.room2.model;

import androidx.annotation.ColorInt;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

//用户表
@Entity(tableName = "t_user")//设置表明
public class User {
    @PrimaryKey(autoGenerate = true)//主键 并自增长
    private long id;

    @ColumnInfo(name = "name")//设置列名
    private String name;

    @ColumnInfo(name = "age")
    private int age;

    @ColumnInfo(name = "address")
    private String address;

    public User(String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}

